#pragma once

// The following ifdef block is the standard way of creating macros which make exporting 
// from a DLL simpler. All files within this DLL are compiled with the RECOGNITION_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see 
// RECOGNITION_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef RECOGNITION_EXPORTS
#define RECOGNITION_API __declspec(dllexport)
#else
#define RECOGNITION_API __declspec(dllimport)
#endif

#include <vector>
namespace NeuralBasic
{
	class Network;
}

namespace MnistDigit
{
	class Digit;
}

namespace Recognition
{
	class Trainer;
	class Tester;
	class RECOGNITION_API Facade
	{
		//enum Operation
		//{

		//};
	public:
		Facade(void);
		~Facade(void);

		void LoadTrainSet(const wchar_t* directory);
		void LoadTestSet(const wchar_t* directory);
		void Train();
		double GetTrainError();
		double Test();
		void CreateNewNetwork();

		size_t GetProgress() const;
		bool IsNetworkValid() const;
	    bool IsTrainSetValid() const;
		bool IsTestSetValid() const;
		void StopTraining();

		void SaveNetwork(const wchar_t* fileName);
		void LoadNetwork(const wchar_t* fileName);
	private:
		typedef std::vector< std::unique_ptr<MnistDigit::Digit>> Digits;
#pragma warning( push )
#pragma warning( disable : 4251 )		
		std::unique_ptr<NeuralBasic::Network> m_network;
		Digits m_testDigits;
		Digits m_trainDigits;

		std::unique_ptr<Tester> m_tester;
		std::unique_ptr<Trainer> m_trainer;
#pragma warning( pop )
	};

}